<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <jsp:include page="WEB-INF/head.jsp"></jsp:include>
    <title>修改联系人</title>
</head>
<body>

<!--布局方式-->
<div class="container" style="width: 40%">
    <!--行-->
    <div class="row">
        <h3 class="text-center has-success">修改contact</h3>

        <form method="get" action="./contactServlet">
            <input type="hidden" name="action" value="update">
            <input type="hidden" name="id" value="${contact.id}">
            <div class="form-group has-success">
                <label class="control-label" for="name">姓名</label>
                <input type="text" class="form-control" id="name" name="name" value="${contact.name}">
            </div>

            <div class="form-group has-warning">
                <label class="control-label" for="sex">性别</label>
                <div class="form-control" id="sex">
                    <input type="radio" name="sex" value="男"
                           <c:if test="${contact.sex == '男'}">checked="checked"</c:if>/>男
                    <input type="radio" name="sex" value="女"
                           <c:if test="${contact.sex == '女'}">checked="checked"</c:if>/>女
                </div>
            </div>


            <div class="form-group has-error">
                <label class="control-label" for="age">年龄</label>
                <input type="text" class="form-control" id="age" name="age" value="${contact.age}">
            </div>
            <div class="form-group has-success">
                <label class="control-label" for="address">地址</label>
                <div id="address">
                    <select name="address" class="form-control">
                        <option value="浙江" <c:if test="${contact.address == '浙江'}">selected="selected"</c:if>>浙江
                        </option>
                        <option value="广西" <c:if test="${contact.address == '广西'}">selected="selected"</c:if>>广西
                        </option>
                        <option value="湖南" <c:if test="${contact.address == '湖南'}">selected="selected"</c:if>>湖南
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group has-warning">
                <label class="control-label" for="qq">qq</label>
                <input type="text" class="form-control" id="qq" name="qq" value="${contact.qq}">
            </div>
            <div class="form-group has-error">
                <label class="control-label" for="email">email</label>
                <input type="email" class="form-control" id="email" name="email" value="${contact.email}">
            </div>
            <div class="form-group has-success">
                <label class="control-label" for="createDate">生日</label>
                <input type="date" class="form-control" id="createDate" name="createDate" value="${contact.createDate}">
            </div>
            <div class="row">
                <div class="col-md-6">
                    <button type="reset" class="btn btn-default btn-group-justified">重置</button>
                </div>
                <div class="col-md-6">
                    <button type="submit" class="btn btn-primary btn-group-justified">确定修改</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<jsp:include page="WEB-INF/footer.jsp"></jsp:include>
</html>